package com.csdj.t309springboot.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csdj.t309springboot.common.WebResult;
import com.csdj.t309springboot.common.WebResultMsgCode;
import com.csdj.t309springboot.entity.IntegralRecord;
import com.csdj.t309springboot.mapper.IntegralRecordMapper;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/page")
@RestController
public class PageController {
    @Resource
    private IntegralRecordMapper integralRecordMapper;

    @GetMapping("/page")
    public WebResult fenYe(@RequestParam(defaultValue = "1") int pageNum,int size){
        Page<IntegralRecord> page = new Page<>( pageNum,size );
        Page<IntegralRecord> integralRecordPage = integralRecordMapper.selectPage(page, null);
        return new WebResult(WebResultMsgCode.SUCCESS,integralRecordPage);
    }

}
